home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / ln03 / rose / dvi2ln3.dif < prev    next >
Text File  |  1990-10-01  |  14KB  |  110 lines

  1. -----------------------------------------------------------------------------------------------------------------------------------
  2. File USER$1:[ROSE.TG.C]DVI2LN3.C;48                              |  File USER$1:[ROSE.TG.UNIX]DVI2LN3.C;1                          
  3. -------------------------------- 3 --------------------------------------------------------------- 3 ------------------------------
  4. Dvi2ln3 is still being developed. Copyright (c) 1985, 1986 by D  |  Dvi2ln3 is still being developed. Copyright (c) 1985, 1986, 198
  5. -------------------------------- 62 -------------------------------------------------------------- 62 -----------------------------
  6. 3/4/86:   Support for landscape added -- very easy, if only I h  |                                                                 
  7.           known. Fixed bug found by Mark DeVries, error returne  |                                                                 
  8.           if \special selects device other than LN03. Version 8  |                                                                 
  9.                                                                  |                                                                 
  10. -------------------------------- 86 -------------------------------------------------------------- 82 -----------------------------
  11. #endif                                                           |  char *strchr(), *malloc(), *getenv();                          
  12.                                                                  |  #endif                                                         
  13. /* Here begins a long list of global variables. */               |                                                                 
  14. -------------------------------- 120 ------------------------------------------------------------- 115 ----------------------------
  15. /* landscape says whether we are printing in landscape or portr  |                                                                 
  16.                                                                  |                                                                 
  17. GLOBAL char landscape;                                           |                                                                 
  18.                                                                  |                                                                 
  19. -------------------------------- 139 ------------------------------------------------------------- 130 ----------------------------
  20.     printf("\n Dvi2ln3 8");                                      |      printf("\n Dvi2ln3 7");                                    
  21. -------------------------------- 151 ------------------------------------------------------------- 142 ----------------------------
  22.     find_VMS_filename(infnam,&jnam,&jext);                       |      find_ULTRIX_filename(infnam,&jnam,&jext);                  
  23. -------------------------------- 163 ------------------------------------------------------------- 154 ----------------------------
  24.     landscape = 0;                                               |                                                                 
  25. -------------------------------- 170 ------------------------------------------------------------- 160 ----------------------------
  26.     if (rewind(dvifile) == -1) {                                 |      rewind(dvifile);                                           
  27.         printf("\n Couldn't rewind dvi file.");                  |                                                                 
  28.         goto exit_label;                                         |                                                                 
  29.     }                                                            |                                                                 
  30. -------------------------------- 189 ------------------------------------------------------------- 176 ----------------------------
  31.     ;                                                            |      printf("\n");                                              
  32. }                                                                |  }                                                              
  33.                                                                  |                                                                 
  34. /* Find_VMS_filename finds the filename part of a VMS filespec   |  /* find_ULTRIX_filename finds the filename part of a VMS filesp
  35. -------------------------------- 201 ------------------------------------------------------------- 188 ----------------------------
  36. int find_VMS_filename(s,ns,ne)                                   |  int find_ULTRIX_filename(s,ns,ne)                              
  37. -------------------------------- 210 ------------------------------------------------------------- 197 ----------------------------
  38.         if (s[j] == ':' || s[j] == ']' ||                        |          if (s[j] == '/') {                                     
  39.             s[j] == '>') {                                       |                                                                 
  40. -------------------------------- 219 ------------------------------------------------------------- 205 ----------------------------
  41.         if (s[j] == '.' || s[j] == ';') {                        |          if (s[j] == '.') {                                     
  42. -------------------------------- 260 ------------------------------------------------------------- 246 ----------------------------
  43. second identifying longword is 8 and third is 3.                 |  second identifying longword is 8 and third is 3. */            
  44.                                                                  |                                                                 
  45. The L option says print in landscape.                            |  /* [[The toupper's below cause difficulty under Ultrix. Probabl
  46.                                                                  |  can be fixed by #including <ctype.h>.]] */                     
  47. [[Is a European option needed?]] */                              |                                                                 
  48. -------------------------------- 283 ------------------------------------------------------------- 268 ----------------------------
  49.         if (toupper(t[0]) == 'L') landscape = 1;                 |                                                                 
  50. -------------------------------- 327 ------------------------------------------------------------- 311 ----------------------------
  51.     jj = creat(outfnam,0);                                       |      jj = creat(outfnam, 0700);                                 
  52. -------------------------------- 749 ------------------------------------------------------------- 733 ----------------------------
  53. /* The margins are set to values that seem appropriate for Amer  |  /* The margins are set to values appropriate for American 8 1/2
  54. by 11" paper. It is not clear if this needs to be changed for E  |  paper. It is not clear if this needs to be changed for European
  55. paper. Not changing it might deprive Europeans of access to the  |  Not changing it might deprive Europeans of access to the bottom
  56. 1.5cm of their paper.                                            |  their paper. */                                                
  57.                                                                  |                                                                 
  58. It is not clear what the printable area is, or what happens whe  |      maxrmar = 2550;                                            
  59. exceeded. */                                                     |      maxbmar = 3300;                                            
  60.                                                                  |                                                                 
  61.     if (landscape == 1) {                                        |  /* In the following, esc[?27h means "advance the carriage by th
  62.         maxrmar = 3300;                                          |  width when you set a character", esc[11h and esc[7 I together m
  63.         maxbmar = 2475;                                          |  interpret all dimensions in escape sequences as pixel units; es
  64.     } else {                                                     |  our origin of coordinates is the upper left edge of the paper; 
  65.         maxrmar = 2550;                                          |  means the "maximum length" of the paper is maxbmar pixels. */  
  66.         maxbmar = 3300;                                          |                                                                 
  67.     }                                                            |      fprintf(outfile,"\033c\033[?27h\033[11h\033[7 I\033[?52h\03
  68.                                                                  |                                                                 
  69. /* In the following, esc[?21 J means print in landscape, esc[?2  |                                                                 
  70. "advance the carriage by the character width when you set a cha  |                                                                 
  71. esc[11h and esc[7 I together mean to interpret all dimensions i  |                                                                 
  72. sequences as pixel units; esc[?52h means our origin of coordina  |                                                                 
  73. upper left edge of the paper; esc[%dt means the "maximum length  |                                                                 
  74. paper is maxbmar pixels. */                                      |                                                                 
  75.                                                                  |                                                                 
  76.     fprintf(outfile,"\033c");                                    |                                                                 
  77.     if (landscape == 1) fprintf(outfile,"\033[?21 J");           |                                                                 
  78.     fprintf(outfile,"\033[?27h\033[11h\033[7 I\033[?52h\033[%dt  |                                                                 
  79. -------------------------------- 919 ------------------------------------------------------------- 892 ----------------------------
  80.     fprintf(outfile,"\n;Dvi2ln3 8 font load\033\\");             |      fprintf(outfile,"\n;Dvi2ln3 7 font load\033\\");           
  81. -------------------------------- 1127 ------------------------------------------------------------ 1100 ---------------------------
  82. about Dvi2ln3 even though the error is in their TeX file).       |  about Dvi2ln3 even though the error is in their TeX file). In m
  83.                                                                  |  dvi2ln3 takes no special action at all, since the LN03 will cli
  84. In most cases, dvi2ln3 takes no special action at all, since th  |  for us. Unfortunately, the LN03 doesn't let us specify negative
  85. clip the glyphs for us. Unfortunately, the LN03 doesn't let us   |  or vertical positions, so we have to clip glyphs at such positi
  86. negative horizontal or vertical positions, so we have to clip g  |  ourselves. The following code accomplishes that: */            
  87. such positions away ourselves. Also, if one sets at a position   |                                                                 
  88. bottom margin, the LN03 will eject a page, so glyphs that are s  |                                                                 
  89. that margin also have to be clipped by hand.                     |                                                                 
  90.                                                                  |                                                                 
  91. The following code accomplishes that: */                         |                                                                 
  92. -------------------------------- 1141 ------------------------------------------------------------ 1109 ---------------------------
  93.             if (vv+voff > 0 && vv+voff <= maxbmar && hh+hoff >   |              if (vv+voff > 0 && hh+hoff > 0) {                  
  94. -------------------------------- 1481 ------------------------------------------------------------ 1449 ---------------------------
  95.                                                                  |      char *texfontdir;                                          
  96.     find_VMS_filename(font_name[nf],&jnam,&jext);                |                                                                 
  97.                                                                  |      find_ULTRIX_filename(font_name[nf],&jnam,&jext);           
  98. -------------------------------- 1487 ------------------------------------------------------------ 1456 ---------------------------
  99.     if (jnam == 0) strcpy(filespec,"tex$fonts:");                |      if (jnam == 0) texfontdir = getenv("TEX_FONTS");           
  100.                                                                  |      strcpy(filespec,texfontdir);                               
  101.                                                                  |      strcat(filespec,"/");                                      
  102. -----------------------------------------------------------------------------------------------------------------------------------
  103.  
  104. Number of difference sections found: 21
  105. Number of difference records found: 78
  106.  
  107. DIFFERENCES /IGNORE=()/OUTPUT=USER$1:[ROSE.TG.C]DVI2LN3.DIF;1/PARALLEL-
  108.     USER$1:[ROSE.TG.C]DVI2LN3.C;48-
  109.     USER$1:[ROSE.TG.UNIX]DVI2LN3.C;1
  110.